﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using T4Ui.Utility;

namespace T4Ui.dal
{
   public  class DbFactory
    {
       public static DbBase GetDbBase()
       {
           DbBase tmpDal = null;
           DbHelper dal = new DbHelper();
           string tmpVal = DbHelper.ProviderName.ToLower();
           if (tmpVal == DbHelper.ProviderOracle)
           {
               tmpDal = new OracleDbBase();
           }
           else if (tmpVal ==DbHelper.ProviderSqlService)
           {
               tmpDal =new  SqlServiceDbBase();
           }
           else
           {
               throw new Exception("db ProviderName:[" + DbHelper.ProviderName + "] not support");
           }
           return tmpDal;
       }
    }
}
